package zisu.algorithm.algorithm.Set;

import java.util.ArrayList;

public class Main {
    public static void main(String[] args) {
        System.out.println("pride-and-prejudice.txt");
        ArrayList<String> list = new ArrayList<>();
        // 传进去的是 引用变量，在里面add 了元素，这里也会显现，， 要注意 Interger 和 类（get/set）的区别。
        FileOperation.readFile("pride-and-prejudice.txt",list);
        System.out.println("Total words :"+list.size());

        BSTSet<String> set1 = new BSTSet<>();
        for(String word : list){
            set1.add(word);
        }
        System.out.println("different words :"+set1.getSize());

        System.out.println("pride-and-prejudice.txt");
        ArrayList<String> list2 = new ArrayList<>();
        // 传进去的是 引用变量，在里面add 了元素，这里也会显现，， 要注意 Interger 和 类（get/set）的区别。
        FileOperation.readFile("pride-and-prejudice.txt",list2);
        System.out.println("Total words :"+list2.size());

        BSTSet<String> set12 = new BSTSet<>();
        for(String word : list2){
            set12.add(word);
        }
        System.out.println("different words :"+set12.getSize());
    }
}
